<template>
  <div class="notice sectionbg">
    <h3>通知通报</h3>
    <ul class="notice-list">
    <li class="list-li" v-for="(item,index) in noticeItem" :key="index">
      <a class="li-text" @click="changeDetail(item)" :href="'#/detail/'+item.id" target="_blank">{{ item.title }}</a>
      <span class="li-timer">{{ item.publish_time }}</span>
    </li>
    </ul>
    <el-pagination
        v-if="total/5 > 1"
        background
        :page-size="5"
        :total="total"
        layout="prev, pager, next"
        prev-text="上一页"
        next-text="下一页"
        @current-change="handleCurrentChange">
    </el-pagination>
</div>
</template>

<script>
export default {
  props: {
    noticeItem: {
      type: Array
    },
    total: {
      type: Number
    }
  },
  data() {
    return {
    }
  },
  methods: {
    handleCurrentChange(val) {
      this.$emit('page', val)
    },
    changeDetail(data){
      // console.log(data);
      this.$emit('data',data);
    }
  }
}
</script>

<style lang="scss">

</style>

